home *** CD-ROM | disk | FTP | other *** search
/ Maclife 157 / MACLIFE157-2001-09.ISO.7z / MACLIFE157-2001-09.ISO / Linux / MacOS Tools / BootX 1.2.2 / Sources / src / miboot / miBoot_low.c < prev    next >
C/C++ Source or Header  |  2001-07-23  |  18KB  |  576 lines

  1. #include <Types.h>
  2. #include <CodeFragments.h>
  3. #include <MixedMode.h>
  4. #include <OSUtils.h>
  5. #include <Processes.h>
  6. #include <Traps.h>
  7. #include <ShutDown.h>
  8. #include <A4Stuff.h>
  9. #include <Video.h>
  10. #include <Palettes.h>
  11. #include <SCSI.h>
  12. #include <Power.h>
  13. #include <Gestalt.h>
  14. #include <LowMem.h>
  15. #include <Displays.h>
  16.  
  17. #include "LowLevelBoot.h"
  18. #include "BootX.h"
  19. #include "debug_text.h"
  20. #include "uLibc.h"
  21.  
  22. #define LINUX_LOGO_COLORS        214
  23. #define CLOSE_VIDEO_DRIVERS        0
  24. #define FAKE_DEBUGGER            0
  25. #define FORCE_SCSI_ON            0
  26. #define DO_POWER_MANAGEMENT        0
  27.  
  28. // This code will do the actual boot
  29.  
  30. // Prototypes
  31. static void            PrepareDisplay(boot_infos_t *bi);
  32. static void            RemoveAnyHWCursor(short driverRefNum);
  33. static void            SetDefaultLinuxCTable(short driverRefNum);
  34. static void            GetColorMap(boot_infos_t* bi, GDHandle device);
  35. static void            SwitchTo8Bits(boot_infos_t* bi, GDHandle gDevice);
  36. static void            ForceUnmountAllVolumes(void);
  37. static Boolean        TrapAvailable(short theTrap);
  38.  
  39. extern Ptr            get_physical(void* ptr);
  40.  
  41. extern unsigned char linux_logo_red[];
  42. extern unsigned char linux_logo_green[];
  43. extern unsigned char linux_logo_blue[];
  44. extern dt_context*     dct;
  45.  
  46.  
  47. inline asm void
  48. DisableInterrupts(void)
  49. {
  50.     ori.w    #0x700, sr
  51. }
  52.  
  53. // Entry point called by BootX to install the shutdown proc.
  54. pascal void
  55. low_boot(PPCRegisterList* regList, boot_infos_t* bi, void* ppc_glue, UInt32 flags, dt_context* in_dct)
  56. {
  57. //    EventRecord    event;
  58.     
  59. //    EnterCodeResource();
  60.  
  61. //    SetZone(SystemZone());
  62.     
  63.     // Unmounts all volumes is not done by shudown proc
  64.     if (LMGetVCBQHdr()->qHead) {
  65.         dt_printf(dct, "Unmounting volumes...¥n");
  66.         ForceUnmountAllVolumes();
  67.     }
  68.         
  69.     dt_printf(dct, "Preparing display...¥n");
  70.     // Prepare displays (setup colormaps for 8 bits displays, remove HW cursors, ...)
  71.     PrepareDisplay(bi);
  72.     
  73.     // Let MacOS think we are a debugger and switch 68k emulator to supervisor first
  74. #if FAKE_DEBUGGER
  75.     DebuggerEnter();
  76. #endif
  77.     
  78.     // Put the emulator in supervisor mode
  79.     dt_printf(dct, "Entering 68k supervisor...¥n");
  80.     EnterSupervisorMode();
  81.     
  82. #if FAKE_DEBUGGER
  83.     // Poll until no more OS events in the queue (safety)
  84.     do {
  85.         if (event.what == nullEvent)
  86.             break;
  87.         DebuggerPoll();
  88.     }
  89.     while(GetOSEvent(everyEvent, &event) != 0);
  90. #endif    
  91.     
  92.     // New BootX no longer care about logical display.
  93.     bi->logicalDisplayBase    = bi->dispDeviceBase;
  94.     
  95.     // Switch emulator interrupts off
  96.     DisableInterrupts();
  97.     
  98.     // Reset some pieces of hardware
  99.     if (ppc_glue)
  100.         ((pascal void(*)(dt_context*,boot_infos_t*))ppc_glue)(dct, bi);
  101.     
  102.     // tempo
  103.     if (dct->visible) {
  104.         UInt32 i;
  105.         dt_printf(dct, "waiting a little bit so you can read all that stuff ...¥n");
  106.         for(i=0;i<0x10000000; i++) {
  107.             (void)*((volatile char *)(0));
  108.         }
  109.     }
  110.     // Enter PPC supervisor (and boot kernel)
  111.     dt_printf(dct, "Entering PPC supervisor...¥n");
  112.     EnterPPCSupervisor(regList);
  113.  
  114.     // Should never reach this point
  115. #if FAKE_DEBUGGER
  116.     DebuggerExit();
  117. #endif
  118. }
  119.  
  120. // This piece of code will unmount all volumes, including the system disk and
  121. // volumes with currently opened files.
  122. void
  123. ForceUnmountAllVolumes(void)
  124. {
  125.     QHdrPtr        vcbQueue;
  126.     VCBPtr        vcb;
  127.     
  128.     vcbQueue = LMGetVCBQHdr();
  129.     while((vcb = (VCBPtr)vcbQueue->qHead) != NULL) {
  130.         ParamBlockRec    pb;
  131.         
  132.         memset(&pb, 0, sizeof(ParamBlockRec));
  133.         pb.volumeParam.ioVRefNum    = vcb->vcbVRefNum;
  134.         pb.volumeParam.ioNamePtr    = NULL;
  135.         PBUnmountVolImmed(&pb);
  136.     }
  137. }
  138.  
  139. // This routine will walk thru all MacOS displays, remove
  140. // hardware cursors and set colormaps to std linux colors for each
  141. // indexed device.
  142. void
  143. PrepareDisplay(boot_infos_t *bi)
  144. {
  145. #if CLOSE_VIDEO_DRIVERS
  146.     static short        sDriverList[16];
  147.     static Str255        sCFMError;
  148.     CFragConnectionID    driverLoaderLib;
  149.     Ptr                    driverLoaderMain;
  150.     int                    driver_count, i;
  151. #endif
  152.     
  153.     OSErr            err;
  154.     GDHandle        device;
  155.     
  156.     // We get default display infos.
  157.     device = GetMainDevice();
  158.     bi->dispDeviceRect[0]            = (**(**device).gdPMap).bounds.left;
  159.     bi->dispDeviceRect[1]            = (**(**device).gdPMap).bounds.top;
  160.     bi->dispDeviceRect[2]            = (**(**device).gdPMap).bounds.right;
  161.     bi->dispDeviceRect[3]            = (**(**device).gdPMap).bounds.bottom;
  162.     bi->dispDeviceDepth                = (**(**device).gdPMap).pixelSize;
  163.     bi->dispDeviceBase                = (UInt8 *)get_physical((UInt8 *)(**(**device).gdPMap).baseAddr);
  164.     bi->dispDeviceRowBytes            = (**(**device).gdPMap).rowBytes & 0x3FFF;
  165.     bi->dispDeviceRegEntryOffset    = NULL; // Not impl. yet
  166.     bi->logicalDisplayBase            = (UInt8 *)(**(**device).gdPMap).baseAddr;
  167.  
  168.     // We loop all displays
  169.     device = GetDeviceList();
  170. #if CLOSE_VIDEO_DRIVERS
  171.     driver_count = 0;
  172. #endif
  173.     while(device)
  174.     {
  175.         if (TestDeviceAttribute(device, screenDevice) && !TestDeviceAttribute(device, noDriver))
  176.         {
  177.             short    refNum = (**device).gdRefNum;
  178.  
  179. #if CLOSE_VIDEO_DRIVERS
  180.             int        found;            
  181.             // Add this driver to the list if it was not already in
  182.             found=0;
  183.             for(i=0; i<driver_count; i++)
  184.                 if (sDriverList[i] == refNum)
  185.                 {
  186.                     found = true;
  187.                     break;
  188.                 }
  189.             if (!found)
  190.                 sDriverList[driver_count++] = refNum;
  191. #endif
  192.                 
  193.             // We need to switch to 8 bits since offb.c cannot handle anything else
  194.             // yet. (Only for the main device)
  195.             if (TestDeviceAttribute(device, mainScreen) && ((**(**device).gdPMap).pixelSize < 8))
  196.                 SwitchTo8Bits(bi, device);
  197.             
  198.             // If the device has indexed colors, we install the standard Linux colormap
  199.             if ((**device).gdType == clutType)
  200.                 SetDefaultLinuxCTable(refNum);
  201.                 
  202.             // We try to blank the hardware cursor. Note that most devices will just make
  203.             // a transparent cursor, so it's a good thing, when not using a full-featured
  204.             // linux video driver, to avoid overriding the framebuffer outside of the
  205.             // defined rectangle. The border might actually contain the cursor.
  206.             RemoveAnyHWCursor(refNum);
  207.         }
  208.         device = GetNextDevice(device);
  209.     }
  210.     
  211.     // Get color map for main device
  212.     GetColorMap(bi, GetMainDevice());
  213.     
  214. #if CLOSE_VIDEO_DRIVERS
  215.     err = GetSharedLibrary("¥pDriverLoaderLib", kAnyCFragArch, kReferenceCFrag,
  216.                         &driverLoaderLib, &driverLoaderMain, sCFMError);
  217.     if (err == noErr)
  218.     {
  219.         CFragSymbolClass    removeDrvrClass;
  220.         Ptr                    removeDrvrProc;
  221.         
  222.         err = FindSymbol(driverLoaderLib, "¥pRemoveDriver", &removeDrvrProc, &removeDrvrClass);
  223.         if (err == noErr)
  224.         {
  225.             enum
  226.             {
  227.                 uppRemoveDriverProcInfo = kCStackBased
  228.                     | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  229.                     | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  230.                     | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean)))
  231.             };
  232.             
  233.             UniversalProcPtr    removeDriverUPP = 
  234.                 NewRoutineDescriptorTrap(    (ProcPtr)removeDrvrProc,
  235.                                              uppRemoveDriverProcInfo,
  236.                                             kPowerPCISA);
  237.             
  238.             // Close all video drivers
  239.             for (i=0; i<driver_count; i++)
  240.             {
  241.                 CloseDriver(sDriverList[i]);
  242.                 ((OSErr (*)(short, Boolean))(removeDriverUPP))(sDriverList[i], false);
  243.             }
  244.         }
  245.     }
  246. #endif
  247. }
  248.  
  249.  
  250. // Gather some infos about the current MacOS main display. This function
  251. // was originally in BootX.c (get_display_infos)
  252. void
  253. GetColorMap(boot_infos_t* bi, GDHandle device)
  254. {
  255.     if ((**device).gdType == clutType)
  256.     {
  257.         unsigned short*        colors = (unsigned short*)(((unsigned long)bi) + bi->dispDeviceColorsOffset);
  258.         CntrlParam            param;        
  259.         VDSetEntryRecord    hwGetEntry;
  260.         int                    i;
  261.         OSErr                err;
  262.         static ColorSpec    sTempColors[256];
  263.         
  264.         memset(¶m, 0, sizeof(CntrlParam));    
  265.         memset(&hwGetEntry, 0, sizeof(VDSetEntryRecord));
  266.         
  267.         param.csCode = cscGetEntries;
  268.         param.ioCRefNum = (**device).gdRefNum;
  269.         hwGetEntry.csTable = sTempColors;
  270.         hwGetEntry.csStart = 0;
  271.         hwGetEntry.csCount = 255;    // csCount is 0 based !!
  272.         *((VDSetEntryRecord **)¶m.csParam[0]) = &hwGetEntry;
  273.         err = PBStatusSync((ParmBlkPtr)¶m);
  274.         if (err == noErr)
  275.             for (i=0; i<256; i++)
  276.             {
  277.                 *(colors++) = sTempColors[i].rgb.red;
  278.                 *(colors++) = sTempColors[i].rgb.green;
  279.                 *(colors++) = sTempColors[i].rgb.blue;
  280.             }
  281.         else
  282.             bi->dispDeviceColorsOffset = 0;
  283.         
  284.     } else
  285.         bi->dispDeviceColorsOffset = 0;
  286. }
  287.  
  288. // Here, we switch the display to 8 bits using driver calls
  289. void
  290. SwitchTo8Bits(boot_infos_t* bi, GDHandle gDevice)
  291. {
  292.     // Lookup the modes supported by he video driver, looking for 8 bits
  293.     CntrlParam                        param;
  294.     VDVideoParametersInfoRec        hwVideoParams;
  295.     VDPageInfo                        hwModeSet;
  296.     VDSwitchInfoRec                    hwModeGet;
  297.     VPBlock                            hwVP;
  298.     short                            i;
  299.     short                            foundDepth;
  300.     OSErr                            err;
  301.     
  302.     memset(¶m, 0, sizeof(CntrlParam));    
  303.     memset(&hwModeSet, 0, sizeof(VDPageInfo));    
  304.     memset(&hwModeGet, 0, sizeof(VDSwitchInfoRec));    
  305.  
  306.         
  307.     param.csCode = cscGetCurMode;
  308.     param.ioCRefNum = (**gDevice).gdRefNum;
  309.     *((VDSwitchInfoRec **)¶m.csParam[0]) = &hwModeGet;
  310.     err = PBStatusSync((ParmBlkPtr)¶m);
  311.     if (err != noErr)
  312.         return;
  313.     
  314.     foundDepth = 0;
  315.     for (i=kDepthMode1; i<=kDepthMode6; i++)
  316.     {
  317.         memset(&hwVideoParams, 0, sizeof(VDVideoParametersInfoRec));    
  318.         memset(&hwVP, 0, sizeof(VPBlock));    
  319.         hwVideoParams.csDisplayModeID    = hwModeGet.csData;
  320.         hwVideoParams.csDepthMode        = i;
  321.         hwVideoParams.csVPBlockPtr        = &hwVP;
  322.         param.csCode = cscGetVideoParameters;
  323.         param.ioCRefNum = (**gDevice).gdRefNum;
  324.         *((VDVideoParametersInfoRec **)¶m.csParam[0]) = &hwVideoParams;
  325.         err = PBStatusSync((ParmBlkPtr)¶m);
  326.         if (err == noErr)
  327.         {
  328.             if (hwVP.vpPixelSize == 8)
  329.             {
  330.                 foundDepth = i;
  331.                 break;
  332.             }
  333.         }
  334.     }
  335.     if (foundDepth != 0)
  336.     {
  337.         hwModeSet.csMode    = foundDepth;
  338.         hwModeSet.csPage    = 0;
  339.         param.csCode = cscSetMode;
  340.         param.ioCRefNum = (**gDevice).gdRefNum;
  341.         *((VDPageInfo **)¶m.csParam[0]) = &hwModeSet;
  342.         err = PBControlSync((ParmBlkPtr)¶m);
  343.         if (err == noErr)
  344.         {
  345.             (**gDevice).gdType    = clutType;
  346.             (**gDevice).gdMode    = foundDepth;
  347.             bi->dispDeviceDepth        = hwVP.vpPixelSize;
  348.             bi->logicalDisplayBase    = (UInt8 *)hwModeSet.csBaseAddr;
  349.             bi->dispDeviceBase        = (UInt8 *)get_physical((UInt8 *)hwModeSet.csBaseAddr);
  350.             bi->dispDeviceRowBytes    = hwVP.vpRowBytes & 0x3FFF;
  351.  
  352.         }
  353.     }
  354. }
  355.  
  356. // Ask the display driver if it supports hardware cursor and remove it.
  357. void
  358. RemoveAnyHWCursor(short driverRefNum)
  359. {
  360.     CntrlParam                        param;
  361.     VDSupportsHardwareCursorRec        hwCursQuery;
  362.     VDDrawHardwareCursorRec            hwCursSet;
  363.     OSErr                            err;
  364.     void*                            genericPtr;
  365.     
  366.  
  367.     memset(¶m, 0, sizeof(CntrlParam));    
  368.     memset(&hwCursQuery, 0, sizeof(VDSupportsHardwareCursorRec));    
  369.     memset(&hwCursSet, 0, sizeof(VDDrawHardwareCursorRec));    
  370.     param.csCode = cscSupportsHardwareCursor;
  371.     param.ioCRefNum = driverRefNum;
  372.     *((VDSupportsHardwareCursorRec **)¶m.csParam[0]) = &hwCursQuery;
  373.     err = PBStatusSync((ParmBlkPtr)¶m);
  374.     if (err != noErr)
  375.         return;
  376.     
  377.     if (!hwCursQuery.csSupportsHardwareCursor)
  378.         return;
  379.     
  380.     memset(¶m, 0, sizeof(CntrlParam));    
  381.     memset(&hwCursSet, 0, sizeof(VDDrawHardwareCursorRec));    
  382.     param.csCode = cscDrawHardwareCursor;
  383.     param.ioCRefNum = driverRefNum;
  384.     *((VDDrawHardwareCursorRec **)¶m.csParam[0]) = &hwCursSet;
  385.     err = PBControlSync((ParmBlkPtr)¶m);
  386. }
  387.  
  388. // Install the linux default color map. We use direct driver calls since the
  389. // Palette Manager may prevent us from setting reserved MacOS colors.
  390. void
  391. SetDefaultLinuxCTable(short driverRefNum)
  392. {
  393.     static ColorSpec    sDefaultLinuxColors[]    =
  394.         {    0,    {    0x0000,    0x0000,    0x0000    },
  395.             1,    {    0x0000, 0x0000, 0xaaaa    },
  396.             2,    {    0x0000, 0xaaaa, 0x0000    },
  397.             3,    {    0x0000, 0xaaaa, 0xaaaa    },
  398.             4,    {    0xaaaa, 0x0000, 0x0000    },
  399.             5,    {    0xaaaa, 0x0000, 0xaaaa    },
  400.             6,    {    0xaaaa, 0xaaaa, 0x0000    },
  401.             7,    {    0xaaaa, 0xaaaa, 0xaaaa    },
  402.             8,    {    0x5555, 0x5555, 0x5555    },
  403.             9,    {    0x5555, 0x5555, 0xffff    },
  404.             10,    {    0x5555, 0xffff, 0x5555    },
  405.             11,    {    0x5555, 0xffff, 0xffff    },
  406.             12,    {    0xffff, 0x5555, 0x5555    },
  407.             13,    {    0xffff, 0x5555, 0xffff    },
  408.             14,    {    0xffff, 0xffff, 0x5555    },
  409.             15,    {    0xffff, 0xffff, 0xffff    } };
  410.             
  411.     CntrlParam                        param;
  412.     VDSetEntryRecord                hwSetEntry;
  413.     OSErr                            err;
  414.     unsigned long                    temp;
  415.     ColorSpec*                        logo_colors;
  416.     int                                i;
  417.     memset(¶m, 0, sizeof(CntrlParam));    
  418.     memset(&hwSetEntry, 0, sizeof(VDSetEntryRecord));
  419.     
  420.     param.csCode = cscSetEntries;
  421.     param.ioCRefNum = driverRefNum;
  422.     hwSetEntry.csTable = sDefaultLinuxColors;
  423.     hwSetEntry.csStart = 0;
  424.     hwSetEntry.csCount = 15;    // csCount is 0 based !!
  425.     *((VDSetEntryRecord **)¶m.csParam[0]) = &hwSetEntry;
  426.     err = PBControlSync((ParmBlkPtr)¶m);
  427.     
  428.     logo_colors = (ColorSpec *)NewPtrSys(sizeof(ColorSpec) * LINUX_LOGO_COLORS);
  429.     if (logo_colors == NULL)
  430.         goto failed;
  431.     for (i=0; i<LINUX_LOGO_COLORS; i++)
  432.     {
  433.         logo_colors[i].value        = i + 32;
  434.         logo_colors[i].rgb.red        = (linux_logo_red[i] << 8) | linux_logo_red[i];
  435.         logo_colors[i].rgb.green    = (linux_logo_green[i] << 8) | linux_logo_green[i]; 
  436.         logo_colors[i].rgb.blue        = (linux_logo_blue[i] << 8) | linux_logo_blue[i]; 
  437.     }
  438.     param.csCode = cscSetEntries;
  439.     param.ioCRefNum = driverRefNum;
  440.     hwSetEntry.csTable = logo_colors;
  441.     hwSetEntry.csStart = 32;
  442.     hwSetEntry.csCount = LINUX_LOGO_COLORS-1;    // csCount is 0 based !!
  443.     *((VDSetEntryRecord **)¶m.csParam[0]) = &hwSetEntry;
  444.     err = PBControlSync((ParmBlkPtr)¶m);
  445.     
  446.     DisposePtr((Ptr)logo_colors);
  447.     
  448. failed:
  449.  
  450.     // Leave some time for the VBL to update the palette
  451.     Delay(10, &temp);
  452. }
  453.  
  454. /*
  455.  * TrapAvailable (see Inside Mac VI 3-8)
  456.  */
  457. #define NumToolboxTraps() (                                ¥
  458.         (NGetTrapAddress(_InitGraf, ToolTrap)            ¥
  459.                 == NGetTrapAddress(0xAA6E, ToolTrap))    ¥
  460.             ? 0x200 : 0x400                                ¥
  461.     )
  462. #define GetTrapType(theTrap) (                            ¥
  463.         (((theTrap) & 0x0800) != 0) ? ToolTrap : OSTrap    ¥
  464.     )
  465.  
  466. static Boolean
  467. TrapAvailable(short theTrap)
  468. {
  469.         TrapType                trapType;
  470.         
  471.         trapType = GetTrapType(theTrap);
  472.         if (trapType == ToolTrap) {
  473.             theTrap &= 0x07FF;
  474.             if (theTrap >= NumToolboxTraps())
  475.                 theTrap = _Unimplemented;
  476.         }
  477.         return (
  478.             NGetTrapAddress(theTrap, trapType)
  479.             != NGetTrapAddress(_Unimplemented, ToolTrap)
  480.         );
  481. }
  482.  
  483.  
  484.  
  485. unsigned char linux_logo_red[] = {
  486.   0x02, 0x9E, 0xE9, 0xC4, 0x50, 0xC9, 0xC4, 0xE9,
  487.   0x65, 0xE3, 0xC2, 0x25, 0xA4, 0xEC, 0x90, 0xA6,
  488.   0xC4, 0x6A, 0xD1, 0xF3, 0x12, 0xED, 0xA0, 0xC2,
  489.   0xB8, 0xD5, 0xDB, 0xD2, 0x3E, 0x16, 0xEB, 0x54,
  490.   0xA9, 0xCD, 0xF5, 0x0A, 0xBA, 0xB3, 0xDC, 0x74,
  491.   0xCE, 0xF6, 0xD3, 0xC5, 0xEA, 0xB8, 0xED, 0x5E,
  492.   0xE5, 0x26, 0xF4, 0xA9, 0x82, 0x94, 0xE6, 0x38,
  493.   0xF2, 0x0F, 0x7F, 0x49, 0xE5, 0xF4, 0xD3, 0xC3,
  494.   0xC2, 0x1E, 0xD5, 0xC6, 0xA4, 0xFA, 0x0A, 0xBA,
  495.   0xD4, 0xEB, 0xEA, 0xEC, 0xA8, 0xBC, 0xB4, 0xDC,
  496.   0x84, 0xE4, 0xCE, 0xEC, 0x92, 0xCD, 0xDC, 0x8B,
  497.   0xCC, 0x1E, 0xF6, 0xB2, 0x60, 0x2A, 0x96, 0x52,
  498.   0x0F, 0xBD, 0xFA, 0xCC, 0xB8, 0x7A, 0x4C, 0xD2,
  499.   0x06, 0xEF, 0x44, 0x64, 0xF4, 0xBA, 0xCE, 0xE6,
  500.   0x8A, 0x6F, 0x3C, 0x70, 0x7C, 0x9C, 0xBA, 0xDF,
  501.   0x2C, 0x4D, 0x3B, 0xCA, 0xDE, 0xCE, 0xEE, 0x46,
  502.   0x6A, 0xAC, 0x96, 0xE5, 0x96, 0x7A, 0xBA, 0xB6,
  503.   0xE2, 0x7E, 0xAA, 0xC5, 0x96, 0x9E, 0xC2, 0xAA,
  504.   0xDA, 0x35, 0xB6, 0x82, 0x88, 0xBE, 0xC2, 0x9E,
  505.   0xB4, 0xD5, 0xDA, 0x9C, 0xA0, 0xD0, 0xA8, 0xC7,
  506.   0x72, 0xF2, 0xDB, 0x76, 0xDC, 0xBE, 0xAA, 0xF4,
  507.   0x87, 0x2F, 0x53, 0x8E, 0x36, 0xCE, 0xE6, 0xCA,
  508.   0xCB, 0xE4, 0xD6, 0xAA, 0x42, 0x5D, 0xB4, 0x59,
  509.   0x1C, 0xC8, 0x96, 0x6C, 0xDA, 0xCE, 0xE6, 0xCB,
  510.   0x96, 0x16, 0xFA, 0xBE, 0xAE, 0xFE, 0x6E, 0xD6,
  511.   0xCE, 0xB6, 0xE5, 0xED, 0xDB, 0xDC, 0xF4, 0x72,
  512.   0x1F, 0xAE, 0xE6, 0xC2, 0xCA, 0xC4
  513. };
  514.  
  515. unsigned char linux_logo_green[] = {
  516.   0x02, 0x88, 0xC4, 0x85, 0x44, 0xA2, 0xA8, 0xE5,
  517.   0x65, 0xA6, 0xC2, 0x24, 0xA4, 0xB4, 0x62, 0x86,
  518.   0x94, 0x44, 0xD2, 0xB6, 0x12, 0xD4, 0x73, 0x96,
  519.   0x92, 0x95, 0xB2, 0xC2, 0x36, 0x0E, 0xBC, 0x54,
  520.   0x75, 0xA5, 0xF5, 0x0A, 0xB2, 0x83, 0xC2, 0x74,
  521.   0x9B, 0xBD, 0xA2, 0xCA, 0xDA, 0x8C, 0xCB, 0x42,
  522.   0xAC, 0x12, 0xDA, 0x7B, 0x54, 0x94, 0xD2, 0x24,
  523.   0xBE, 0x06, 0x65, 0x33, 0xBB, 0xBC, 0xAB, 0x8C,
  524.   0x92, 0x1E, 0x9B, 0xB6, 0x6E, 0xFB, 0x04, 0xA2,
  525.   0xC8, 0xBD, 0xAD, 0xEC, 0x92, 0xBC, 0x7B, 0x9D,
  526.   0x84, 0xC4, 0xC4, 0xB4, 0x6C, 0x93, 0xA3, 0x5E,
  527.   0x8D, 0x13, 0xD6, 0x82, 0x4C, 0x2A, 0x7A, 0x5A,
  528.   0x0D, 0x82, 0xBB, 0xCC, 0x8B, 0x6A, 0x3C, 0xBE,
  529.   0x06, 0xC4, 0x44, 0x45, 0xDB, 0x96, 0xB6, 0xDE,
  530.   0x8A, 0x4D, 0x3C, 0x5A, 0x7C, 0x9C, 0xAA, 0xCB,
  531.   0x1C, 0x4D, 0x2E, 0xB2, 0xBE, 0xAA, 0xDE, 0x3E,
  532.   0x6A, 0xAC, 0x82, 0xE5, 0x72, 0x62, 0x92, 0x9E,
  533.   0xCA, 0x4A, 0x8E, 0xBE, 0x86, 0x6B, 0xAA, 0x9A,
  534.   0xBE, 0x34, 0xAB, 0x76, 0x6E, 0x9A, 0x9E, 0x62,
  535.   0x76, 0xCE, 0xD3, 0x92, 0x7C, 0xB8, 0x7E, 0xC6,
  536.   0x5E, 0xE2, 0xC3, 0x54, 0xAA, 0x9E, 0x8A, 0xCA,
  537.   0x63, 0x2D, 0x3B, 0x8E, 0x1A, 0x9E, 0xC2, 0xA6,
  538.   0xCB, 0xDC, 0xD6, 0x8E, 0x26, 0x5C, 0xB4, 0x45,
  539.   0x1C, 0xB8, 0x6E, 0x4C, 0xBC, 0xAE, 0xD6, 0x92,
  540.   0x63, 0x16, 0xF6, 0x8C, 0x7A, 0xFE, 0x6E, 0xBA,
  541.   0xC6, 0x86, 0xAA, 0xAE, 0xDB, 0xA4, 0xD4, 0x56,
  542.   0x0E, 0x6E, 0xB6, 0xB2, 0xBE, 0xBE
  543. };
  544.  
  545.  
  546. unsigned char linux_logo_blue[] = {
  547.   0x04, 0x28, 0x10, 0x0B, 0x14, 0x14, 0x74, 0xC7,
  548.   0x64, 0x0E, 0xC3, 0x24, 0xA4, 0x0C, 0x10, 0x20,
  549.   0x0D, 0x04, 0xD1, 0x0D, 0x13, 0x22, 0x0A, 0x40,
  550.   0x14, 0x0C, 0x11, 0x94, 0x0C, 0x08, 0x0B, 0x56,
  551.   0x09, 0x47, 0xF4, 0x0B, 0x9C, 0x07, 0x54, 0x74,
  552.   0x0F, 0x0C, 0x0F, 0xC7, 0x6C, 0x14, 0x14, 0x11,
  553.   0x0B, 0x04, 0x12, 0x0C, 0x05, 0x94, 0x94, 0x0A,
  554.   0x34, 0x09, 0x14, 0x08, 0x2F, 0x15, 0x19, 0x11,
  555.   0x28, 0x0C, 0x0B, 0x94, 0x08, 0xFA, 0x08, 0x7C,
  556.   0xBC, 0x15, 0x0A, 0xEC, 0x64, 0xBB, 0x0A, 0x0C,
  557.   0x84, 0x2C, 0xA0, 0x15, 0x10, 0x0D, 0x0B, 0x0E,
  558.   0x0A, 0x07, 0x10, 0x3C, 0x24, 0x2C, 0x28, 0x5C,
  559.   0x0A, 0x0D, 0x0A, 0xC1, 0x22, 0x4C, 0x10, 0x94,
  560.   0x04, 0x0F, 0x45, 0x08, 0x31, 0x54, 0x3C, 0xBC,
  561.   0x8C, 0x09, 0x3C, 0x18, 0x7C, 0x9C, 0x7C, 0x91,
  562.   0x0C, 0x4D, 0x17, 0x74, 0x0C, 0x48, 0x9C, 0x3C,
  563.   0x6A, 0xAC, 0x5C, 0xE3, 0x29, 0x3C, 0x2C, 0x7C,
  564.   0x6C, 0x04, 0x14, 0xA9, 0x74, 0x07, 0x2C, 0x74,
  565.   0x4C, 0x34, 0x97, 0x5C, 0x38, 0x0C, 0x5C, 0x04,
  566.   0x0C, 0xBA, 0xBC, 0x78, 0x18, 0x88, 0x24, 0xC2,
  567.   0x3C, 0xB4, 0x87, 0x0C, 0x14, 0x4C, 0x3C, 0x10,
  568.   0x17, 0x2C, 0x0A, 0x8C, 0x04, 0x1C, 0x44, 0x2C,
  569.   0xCD, 0xD8, 0xD4, 0x34, 0x0C, 0x5B, 0xB4, 0x1E,
  570.   0x1D, 0xAC, 0x24, 0x18, 0x20, 0x5C, 0xB4, 0x1C,
  571.   0x09, 0x14, 0xFC, 0x0C, 0x10, 0xFC, 0x6C, 0x7C,
  572.   0xB4, 0x1C, 0x15, 0x17, 0xDB, 0x18, 0x21, 0x24,
  573.   0x04, 0x04, 0x44, 0x8C, 0x8C, 0xB7
  574. };
  575.  
  576.